package com.mask.im.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mask.im.business.model.dto.AnnouncementDTO;
import com.mask.im.business.model.entity.AnnouncementDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;



@Mapper
public interface AnnouncementMapper extends BaseMapper<AnnouncementDO> {

	List<AnnouncementDO> getLastAnnouncement();

	Integer draftAnnouncementCount(@Param("title") String title,
	                               @Param("status") Integer status);

	List<AnnouncementDTO> draftAnnouncement(@Param("title") String title,
	                                        @Param("status") Integer status,
	                                        @Param("currentPage") long currentPage,
	                                        @Param("size") long size);

	Integer  publishAnnouncementCount(@Param("publishDate") String publishDate,
	                               @Param("title") String draftTitle);

	List<AnnouncementDTO> publishAnnouncement(@Param("publishDate") String publishDate,
	                                          @Param("title") String draftTitle,
	                                          @Param("currentPage") long currentPage,
	                                          @Param("size") long size);
}

